package com.gem.day19;

import java.time.LocalDate;
import java.util.List;

import lombok.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Student {
	private Long id;
	private String name;
	private LocalDate birthday;
	private Gender gender;
	private List<Address> addresses;

	public Student(Long id, String name, LocalDate birthday, Gender gender) {
		super();
		this.id = id;
		this.name = name;
		this.birthday = birthday;
		this.gender = gender;
	}

	@Override
	public String toString() {
		String result = "id=" + id + ", name=" + name + ", birthday=" + birthday + ", gender=" + gender;
		if (addresses != null && addresses.size() > 0) {
			result += "\n" + addresses;
		} else {
			result += "\n流浪中...";
		}
		return result;
	}
}
